package gbench.appdemo.medicine.chemistry.solution;

import gbench.appdemo.medicine.chemistry.organic.Water;
import gbench.appdemo.medicine.chemistry.particle.Formula;
import gbench.appdemo.medicine.chemistry.particle.Particle;

public class Solvent extends Particle {
    
    public Solvent(String name){
        super(name);
    }
    
    public Solvent(final Particle particle){
        super(particle);
    }
    
    public Solvent(String name,double volume){
        super(name);
        this.volume = volume;
    }
    

    /**
     * @return the volume
     */
    public double getVolume() {
        return volume;
    }

    /**
     * @param volume the volume to set
     */
    public void setVolume(double volume) {
        this.volume = volume;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }
    
    /**
     * 
     * @param solution 溶剂
     * @return
     */
    public double volume(Solution solution) {
        return getVolume();
    }

    public static Solvent of(String name) {
        final var particle = Formula.parse(name);
        return new Solvent(particle._1());
    }

    private double volume;
    private String unitName = "ml";
    
    public static Solvent WATER = new Solvent(new Water());
}
